<template>
  <el-container class="index-box">
    <el-aside width="asideWidth">
      <div class="logoBox d-flex" ><!-- :style="{width:(!collapse?'240px':'64px')}" -->
      	<img src="@/assets/logo.png" alt="" class="logoImg">
      	<span v-show="!isCollapse">Megad管理系统</span>
      </div>
      <menus :isCollapse="isCollapse"/>
    </el-aside>
    <el-container>
      <el-header style="height:103px">
        <headers/>
        <tabs/>
      </el-header>
      <el-main>
          <div id="mainBackbone">
              <transition name="fade-transform" mode="out-in">
                  <!-- <keep-alive exclude='dictionariesDetail,shopDetails'> -->
                    <router-view v-if="isRouterAlive" :key="$route.fullPath"/>
                 <!-- </keep-alive> -->
              </transition>
          </div>
           <div class="copyright"> <a href="https://beian.miit.gov.cn" target="_blank">粤ICP备2024299708号-2 </a></div>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import Menus from '@/components/Menus/menus'
import Headers from '@/components/Header/header'
import Tabs from '@/components/Tabs/tabs'
export default {
  provide () {
    return {
      reload: this.reload
    }
  },
  data () {
    return {
      isRouterAlive: true
    }
  },
  components: {
    Menus,
    Headers,
    Tabs
  },
  methods: {
    reload () {
      this.isRouterAlive = false
      this.$nextTick(() => {
        this.isRouterAlive = true
      })
    }
  },
  computed: {
    isCollapse () {
      return this.$store.state.isCollapse
    },
    asideWidth () {
      return this.$store.state.isCollapse ? 'auto' : '200px'
    }
  }
}
</script>

<style lang="scss">
  .copyright{
      text-align: center;
      color:#606266;
      font-size: 12px;
      margin-bottom: 10px;
	  position: fixed;
	  bottom: 1px;
	  display: flex;
	  justify-content: center;
	  width: calc(100% - 200px);

    }
  #mainBackbone>.index-box{
    height:100%;
  }
  #mainBackbone{
    height: calc(100vh - 155px);
    margin:15px 15px 10px 15px;
    background: #fff;
  }
  .logoBox{
    display: flex;
    align-items: center;
    padding:0 10px;
    height:60px;
    font-size: 16px;
    font-weight: bold;
    color:#FFF;
    .logoImg{
      width: 40px;
      height: 40px;
      border-radius: 50%;
    }
    span{
      font-size: 15px;
      font-weight: 600;
      margin-left: 10px;
      color:#000;
    }
  }
.index-box /deep/ .el-menu.el-menu--inline	li{
	//background: #1f2d3d!important;
}
.index-box /deep/ .el-menu.el-menu--inline li:hover{
	background: #fff!important;
}
#app>.index-box {
  font-family:sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #F1F1F1;
  height: 100vh;
  .el-container{
    height: 100%;
    .el-main {
      height: 100%;
      padding:0px!important;
	  background: #f0f2f5;
	  overflow-x: hidden;
    }
  }
  .el-aside {
    background-color: #fff;
    height: 100vh;
    min-height: 100%;
    .logo {
      background-color: #304156;
      color: rgba(255,255,255,.8);
      text-align: center;
      height: 60px;
      padding-top: 16px;
      font-size: 16px;
      box-sizing: border-box;
      border-bottom: 1px solid gray;
    }
  }
  .el-header {
    border-bottom: 1px solid #f6f6f6;
    box-sizing: border-box;
    background-color: #fff;
    line-height: 60px;
    padding:0 15px;
  }
}
</style>
